<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>验证兑换码</title>
 <meta charset="utf-8">
   
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Amaze UI Admin index Examples</title>
    <meta name="description" content="这是一个 index 页面">
    <meta name="keywords" content="index">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
<!--     <link rel="icon" type="image/png" href="../assets/i/favicon.png">
    <link rel="apple-touch-icon-precomposed" href="../assets/i/app-icon72x72@2x.png"> -->
    <meta name="apple-mobile-web-app-title" content="Amaze UI"/>
  <!--   <link rel="stylesheet" href="../assets/css/amazeui.min.css"/>
    <link rel="stylesheet" href="../assets/css/admin.css"> -->
    <link rel="stylesheet" href="../assets/js/layui/css/layui.css" media="all" />
     <style type="text/css">
    	div.codeinput{width: 656px ; margin:10px auto;}
    </style>
</head>
<body>
	  <div class=" admin-content">

		<!-- 
        <div class="am-popup am-popup-inner" id="my-popups">

            <div class="am-popup-hd">
                <h4 class="am-popup-title">修改栏目名称</h4>
                <span data-am-modal-close
                      class="am-close">&times;</span>
            </div>

            <div class="am-popup-bd">


                <form class="am-form tjlanmu">


                    <div class="am-form-group">
                        <div class="zuo">栏目名称：</div>
                        <div class="you">
                            <input type="email" class="am-input-sm" id="doc-ipt-email-1" placeholder="请输入标题">
                        </div>
                    </div>
                    <div class="am-form-group">
                        <div class="zuo">栏目关键词：</div>
                        <div class="you">
                            <input type="password" class="am-input-sm" id="doc-ipt-pwd-1" placeholder="请输入关键词">
                        </div>
                    </div>
                    <div class="am-form-group am-cf">
                        <div class="zuo">栏目描述：</div>
                        <div class="you">
                            <textarea class="" rows="2" id="doc-ta-1"></textarea>
                        </div>
                    </div>
                    <div class="am-form-group am-cf">
                        <div class="zuo">栏目图片：</div>
                        <div class="you" style="height: 45px;">
                            <input type="file" id="doc-ipt-file-1">
                            <p class="am-form-help">请选择要上传的文件...</p>
                        </div>
                    </div>
                    <div class="am-form-group am-cf">
                        <div class="zuo">简介：</div>
                        <div class="you">
                            <textarea class="" rows="2" id="doc-ta-2"></textarea>
                        </div>
                    </div>
                    <div class="am-form-group am-cf">
                        <div class="zuo">状态：</div>
                        <div class="you" style="margin-top: 3px;">
                            <label class="am-checkbox-inline">
                                <input type="checkbox" value="option1">
                                显示 </label>
                            <label class="am-checkbox-inline">
                                <input type="checkbox" value="option2">
                                隐藏 </label>

                        </div>
                    </div>
                    <div class="am-form-group am-cf">
                        <div class="you">
                            <p>
                                <button type="submit" class="am-btn am-btn-success am-radius">提交</button>
                            </p>
                        </div>
                    </div>
                </form>


            </div>


        </div> -->


        <div class="admin-biaogelist">

            <div class="listbiaoti am-cf">
                <ul class="am-icon-flag on"> 兑换验证码</ul>

                <dl class="am-icon-home" style="float: right;">当前位置： 首页 > <a href="">兑换验证码</a></dl>

                <!--<dl>
                    <button type="button" class="am-btn am-btn-danger am-round am-btn-xs am-icon-plus"> 补充线订单</button>
                </dl>
                这里打开的是新页面-->


            </div>	
			<div id="test" class="test">
				<form id="orderCode_from" class="am-form am-g">
					<div class="codeinput">
             		请输入兑换码   <input id="orderCode" name="orderCode" />
             		<button type="reset" class="layui-btn layui-btn-sm" value="重置" >重置</button> <button id="orderCode_bt" class="layui-btn layui-btn-sm" type="button" value="提交" >提交 </button>
					</div>
             	</form>	 

			</div>
			
			 <div >
            	 <table id="orderCode_tb" width="100%" class="am-table am-table-bordered am-table-radius am-table-striped am-table-hover">
                    <thead>
                   <tr class="am-success">
                    	<th width="90px" class="table-set">订单编号</th>
                        <th class="table-title">电影名称</th>
                        <th  class="table-type">影厅</th>
                        <th  class="table-author am-hide-sm-only">座位</th>
                        <th  class="table-author am-hide-sm-only">购票数量</th>
                        <th class="table-author am-hide-sm-only">购票价格</th>
                        <th class="table-date am-hide-sm-only">购票日期</th>
                        <th  class="table-author am-hide-sm-only">购票用户</th>
                        <th width="80px" class="table-set">操作</th>
                    </tr>
                    </thead>
                    <tbody id="orderCode_List">
                    	
                    </tbody>
                    
                </table>
            
            </div>
        </div>
		
    </div>
	
	 <script id="template_order" type="text/html">
			<tr>	
 				   <td id="orderId"> {{d.id }} </td>
                   <td id="movieName"> {{d.schedule.movieName }} </td>
				   <td id="description"> {{d.schedule.description }} </td>
				   <td id="seats"> {{# for(var i=0;i<d.seatList.length;i++){ }} 
											<span>{{ d.seatList[i].row }}排{{ d.seatList[i].line }}座</span>

									{{# } }}
						</td>
                   <td id="movieCount"> {{d.count }} </td>
                   <td id="adjustedPrice" class="am-hide-sm-only">{{d.adjustedPrice}}</td>
                   <td id="buyDate" class="am-hide-sm-only">{{d.buyDate}}</td>
                   <td id="userName" class="am-hide-sm-only"> {{d.userName}}</td>
				   <td id="print" class="am-hide-sm-only"> <a href="javascript:void(0)">打印</a></td>
             </tr>

	</script>
	<script  src="../assets/js/jquery.form.js"></script> 
 	<script src="../assets/js/amazeui.min.js"></script>
 	<script type="text/javascript">
	$(function(){
		$("#orderCode_tb").hide();
		
	});
	
	$("#orderCode_bt").click(function(){
		var orderCode = $("#orderCode").val();
		if($.trim(orderCode) == ""){
			layer.msg("兑换码不能为空");
			return false;
		}
		$("#orderCode_from").ajaxSubmit({
			url:"/moviesMaven/order/getOrderByCode.htm",
			dataType:"json",
			success:function(data){
				if(data.success){//查询成功
					$("#orderCode_tb").show();	
					renderData_order(data.result)
				}else{
					layer.msg(data.message);
				}
			},
			error:function(XMLHttpRequest, textStatus, errorThrown) {
				layer.msg(textStatus+":"+XMLHttpRequest.status);
			}
			
			
		})
	});
		

 	

	//模板引擎渲染页面
	function  renderData_order(data){
		
		layui.use("laytpl",function(){
			var laytpl = layui.laytpl;
			
			var template_order = $("#template_order").html();
			laytpl(template_order).render(data,function(html){
				$("#orderCode_List").html(html);
		
			});
			

		});

	}


</script>

</body>
</html>